import request from '@/utils/request'

// 查询课程列表
export function listCourse(query) {
  return request({
    url: '/feedback/course/list',
    method: 'get',
    params: query
  })
}

// 查询课程详细
export function getCourse(id) {
  return request({
    url: '/feedback/course/' + id,
    method: 'get'
  })
}

// 新增课程
export function addCourse(data) {
  return request({
    url: '/feedback/course',
    method: 'post',
    data: data
  })
}

// 修改课程
export function updateCourse(data) {
  return request({
    url: '/feedback/course',
    method: 'put',
    data: data
  })
}

// 删除课程
export function delCourse(id) {
  return request({
    url: '/feedback/course/' + id,
    method: 'delete'
  })
}
// 所以未开这门课的班级
export function unallocatedClazzList(query) {
  return request({
    url: '/feedback/course/clazz/unallocatedList',
    method: 'get',
    params: query
  })
}
// 所以已经开这门课的班级
export function allocatedClazzList(query) {
  return request({
    url: '/feedback/course/clazz/allocatedList',
    method: 'get',
    params: query
  })
}

// 选择班级开课
export function clazzSelectAll(data) {
  return request({
    url: '/feedback/course/clazz/selectAll',
    method: 'put',
    params: data
  })
}
  // 选择班级开课
export function clazzUnSelectAll(data) {
  return request({
    url: '/feedback/course/clazz/unselectAll',
    method: 'put',
    params: data
  })
}
